package com.qf.pay.app.service.impl;

import com.qf.pay.app.dao.AppUserDAO;
import com.qf.pay.app.pojo.AppUser;
import com.qf.pay.app.service.AppUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AppUserServiceImpl implements AppUserService {

    @Autowired
    private AppUserDAO appUserDAO;

    @Override
    public AppUser doLogin(String username, String password) {
        AppUser appUser = appUserDAO.getUserByName(username);
        if (appUser == null || !password.equals(appUser.getPassword())) {
            return null;
        }
        return appUser;
    }
}
